/**各个模块的ID及其对应的manuscriptWorkType、manuscriptWorkStatus*/
//去除字符串的空格函数,是去除字符串前后、中间的空格
function trim(str,is_global) 
{ 
   var result; 
       result = str.replace(/(^\s+)|(\s+$)/g,""); 
  if(is_global.toLowerCase()=="g") 
       result = result.replace(/\s/g,""); 
       return result; 
} 
//alert(trim(" 1 2 3 ","g"));
var manuscriptWorkType=null;
var manuscriptWorkStatus=null;
var rolename='';
var value=module.id;//可以判定是进去的哪一个js
function checkModuleId(value){
	switch(value){
	case "receiver-translaterContribute":
		return manuscriptWorkType=1,manuscriptWorkStatus=2,rolename='翻译交稿';
		break;
	case "receiver-checkerContribute":
		return manuscriptWorkType=2,manuscriptWorkStatus=2,rolename='校审交稿';
		break;
	case "receiver-reviserContribute":
		return manuscriptWorkType=3,manuscriptWorkStatus=2,rolename='校对交稿';
		break;
	case "receiver-reviewerContribute":
		return manuscriptWorkType=4,manuscriptWorkStatus=2,rolename='审核交稿';
		break;
	}
}
checkModuleId(value);//初始化上面的函数
var rs_draw = new Ext.data.JsonReader({
    root: 'manuscriptWorks',
    totalProperty: 'totalCount'
}, [{
    name: 'urgence',// 紧急程度，取值见urgence常量
    mapping: 'manuscript.urgence',
    hidden: 'true'
}, {
    name: 'securityClassification',// 密级，取值见securityClassification常量
    mapping: 'manuscript.securityClassification',
    hidden: 'true'
},{
	name:'manuscriptWorkId',//稿件工作id
	mapping:'manuscriptWorkId',
	hidden:'true'
}, {
    name: 'manuscriptId',// 稿件标识
    mapping: 'manuscript.manuscriptId',
    hidden: 'true'
},{
	name:'principalName',//统稿人
	mapping:'principalName',
	hidden:'true'
}, {
    name: 'title',// 稿件标题
    mapping: 'manuscript.title'
}, {
    name: 'contributeCompanyName',// 稿件公司名字
    mapping: 'manuscript.contributeCompany.contributeCompanyName'
}, {
    name: 'manuscriptCategoryName',// 稿件分类名字
    mapping: 'manuscript.manuscriptCategory.manuscriptCategoryName'
}, {
    name: 'plannedFinishedTime',// 计划完成时间
    mapping: 'plannedFinishedTime'
}]);

var ds_draw = new Ext.data.Store({
		baseParams:{
			manuscriptWorkType:manuscriptWorkType,              //稿件工作类型：1代表翻译人
			manuscriptWorkStatus:manuscriptWorkStatus             //稿件工作状态：2代表工作进行中,即已经领稿,处于交稿模块中
		},
    proxy: new Ext.data.HttpProxy({
        url: 'receiver_ManuscriptWorksForRecipient_list.action',
        method: 'POST'
    }),
    reader: rs_draw
});
var cm_draw = new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), {
    header: "稿件标题",
    width: 100,
    dataIndex: 'title',
    sortable: true,
    renderer: function(value, metadata, record){
        return "<a href = 'javascript:void(0)' onclick=javascript:showdrawView('" +
        record.data.manuscriptId +
        "')> " +
        escapeHTML(value) +
        " </a>";
    }
}, {
    header: "来稿单位",
    width: 120,
    dataIndex: 'contributeCompanyName'

}, {
    header: "稿件分类",
    width: 120,
    dataIndex: 'manuscriptCategoryName'

}, {
    header: "要求完成时间",
    width: 120,
    dataIndex: 'plannedFinishedTime',
    sortable: true,
    renderer: function(value, metadata, record){
	      return new Date(value).format('Y-m-d');
    }
}, {
    header: "标识",
    width: 120,
    dataIndex: 'manuscriptId',
    renderer: function(value, metadata, record){
        return tomark(value, metadata, record);
        
    }
}, {
    header: "操作",
    width: 120,
    dataIndex: 'manuscriptId',
    renderer: function(value, metadata, record){
	 return "<a href = 'javascript:void(0)'   onclick=javascript:contribute('" +
      record.data.manuscriptWorkId +"','"+escapeHTML(trim(record.data.title,"g"))+"','"+record.data.contributeCompanyName+"','"+record.data.principalName+"','"+record.data.securityClassification+"','"+record.data.manuscriptId+"')>"+rolename+" </a>" +
      		"&nbsp;&nbsp<a href='javascript:void(0)' onclick=javascript:detailsView('" +record.data.manuscriptWorkId+"')>查看</a>";
    }
}]);

// 时间操作START
function totime(value, metadata, record){
    return new Date(value).format('Y-m-d H:i');
    
}

// 时间操作END
// 来稿START
function toisBoss(value){
    if (value == userId) {
        return true;
    }
    else {
        return false;
    }
}

function tourgence(value){

    switch (value) {
        case 0:
            return "普通";
            break;
        case 5:
            return "紧急";
            break;
        case 10:
            return "特急";
            break;
    }
    
}

function tosecurityClassification(value){

    switch (value) {
        case 1:
            return "普通";
            break;
        case 2:
            return "秘密";
            break;
        case 3:
            return "机密";
            break;
        case 5:
            return "绝密";
            break;
    }
    
}

function tolanguage(value){

    switch (value) {
        case 1:
            return "汉语";
            break;
        case 2:
            return "藏语";
            break;
    }
    
}

function totargetLanguage(value){

    switch (value) {
        case 1:
            return "汉语";
            break;
        case 2:
            return "藏语";
            break;
    }
    
}

function totexttype(value){

    switch (value) {
        case 0:
            return "纸质稿件";
            break;
        case 0x0100:
            return "电子稿件";
            break;
    }
    
}

function totype(value) {
	if(value=="DW"){
		return "党委";
	}else if(value=="RD"){
		return "人大";
	}else if(value=="ZF"){
		return "政府";
	}else if(value=="ZX"){
		return "政协";
	}else if(value=="QT"){
		return "其他";
	}else{
		return value;
	}
}

function toisAll(value){
    var fag = 0;
    for (var i = 0; i < value.length; i++) {
        if (value[i].status == 5) {
            fag++;
        }
    };
    if (fag == value.length) {
        return true;
    }
    else {
        return false;
    }
}

function toisElectronic(value){
    switch (value) {
        case 0:
            return false;
            break;
        case 0x0100:
            return true;
            break;
    }
    
}

// 来稿END
// 表单START
var urgence;
var securityClassification;
var language;
var targetLanguage;
var contributeTime;
var plannedConsummationTime;
var type;
var texttype;
var isAll = true;
var isElectronic = true;
function formchange(respText){
	isElectronic = toisElectronic(respText.manuscript.type);
	urgence = tourgence(respText.manuscript.urgence);
	securityClassification = tosecurityClassification(respText.manuscript.securityClassification);
	language = tolanguage(respText.manuscript.language);
	targetLanguage = totargetLanguage(respText.manuscript.targetLanguage);
	contributeTime = totime(respText.manuscript.contributeTime, "", "");
	plannedConsummationTime = totime(
			respText.manuscript.plannedConsummationTime, "", "");
	texttype = totexttype(respText.manuscript.type);
	type = totype(respText.manuscript.contributeCompany.type);
}

// 表单END
// 标志START
var re;
function tomark(value, metadata, record) {
    var title = '&nbsp;密级&nbsp;&nbsp;&nbsp;&nbsp;紧急程度&nbsp;';
    var tip;
    var s1 = "&nbsp;普通&nbsp;&nbsp;&nbsp;&nbsp;";
    var s2 = "&nbsp;秘密&nbsp;&nbsp;&nbsp;&nbsp;";
    var s3 = "&nbsp;机密&nbsp;&nbsp;&nbsp;&nbsp;";
    var s5 = "&nbsp;绝密&nbsp;&nbsp;&nbsp;&nbsp;";
    var u0 = "&nbsp;&nbsp;&nbsp;普通&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    var u5 = "&nbsp;&nbsp;&nbsp;紧急&nbsp;&nbsp;&nbsp;&nbsp;";
    var u10 = "&nbsp;&nbsp;&nbsp;特急";
    var c0 = "&nbsp<img src='images/clock_blue.gif'  />&nbsp";// 普通urgence
    var c5 = "&nbsp<img src='images/clock_green.gif' />&nbsp";// 紧急
    var c10 = "&nbsp<img src='images/clock_red.gif' />&nbsp";// 特急
    var l1 = "&nbsp<img src='images/lock_blue.gif'  />&nbsp";// 普通securityClassification
    var l2 = "&nbsp<img src='images/lock_gold.gif'/>&nbsp"; // 秘密
    var l3 = "&nbsp<img src='images/lock_green.gif' />&nbsp";// 机密
    var l5 = "&nbsp<img src='images/lock_red.gif'  />&nbsp";// 绝密
    switch (record.data.securityClassification) {
        case 1:
            switch (record.data.urgence) {
                case 0:
                	re = l1 + c0;
                    tip = s1 + u0;
                    break;
                case 5:
                	re = l1 + c5 ;
                    tip = s1 + u5;
                    break;
                case 10:
                	re = l1 + c10;
                    tip = s1 + u10;
                    break;
            }
            break;
        case 2:
            switch (record.data.urgence) {
                case 0:
                	re = l2 + c0;
                    tip = s2 + u0;
                    break;
                case 5:
                	re = l2 + c5;
                    tip = s2 + u5;
                    break;
                case 10:
                	re = l2 + c10;
                    tip = s2 + u10;
                    break;
            }
            break;
        case 3:
            switch (record.data.urgence) {
	            case 0:
	            	re = l3 + c0;
	                tip = s3 + u0;
	                break;
	            case 5:
	            	re = l3 + c5;
	                tip = s3 + u5;
	                break;
	            case 10:
	            	re = l3 + c10;
	                tip = s3 + u10;
	                break;
            }
            
            break;
        case 5:
            switch (record.data.urgence) {
	            case 0:
	            	re = l5 + c0;
	                tip = s5 + u0;
	                break;
	            case 5:
	            	re = l5 + c5;
	                tip = s5 + u5;
	                break;
	            case 10:
	            	re = l5 + c10;
	                tip = s5 + u10;
	                break;
	            }
            break;
    }
    metadata.attr = 'ext:qtitle="' + title + '"' + ' ext:qtip="' + tip + '"';
    return re;
}
// 标志END

// 查看稿件
window.showdrawView = function(needParam){
    Ext.Ajax.request({
        url: 'receiver_manuscriptInfo_view.action',
        method: 'post',
        params: {
            manuscriptId: needParam
        },
        success: function(resp, opts){
            var respText = Ext.util.JSON.decode(resp.responseText);
            if (respText.success) {
				formchange(respText);
				var mywindow = new Ext.Window({
					title : '稿件详情',
					width : 600,
					constrainHeader:true, 
					resizable : false,
					autoHeight : true,
					modal : true,
					closable:false,  
					iconCls:'manuscript',
					closeAction : 'hide',
					items : [new Ext.FormPanel({
						border : false,
						labelAlign : 'right',
						plain:true,
						labelWidth : 100,
						frame : true,
						items : [{
							fieldLabel : '稿件标题',
							xtype : 'textfield',
							readOnly : true,
							value : respText.manuscript.title,
							anchor : '93%',
							itemCls:'unedit'
						},{
							autoHeight : true,
							xtype : 'textfield',
							fieldLabel : '稿件编号',
							readOnly : true,
							value : respText.manuscript.manuscriptCode,
							itemCls:'form_text unedit'
						},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '来稿单位',
										readOnly : true,
										value : respText.manuscript.contributeCompany.contributeCompanyName,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '来稿单位类型',
										readOnly : true,
										value : respText.manuscript.contributeCompany.type,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '来稿人',
										readOnly : true,
										value : respText.manuscript.contributeCompanyPerson.name,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '稿件编号',
										readOnly : true,
										value : respText.manuscript.manuscriptCode,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '联系人手机',
										readOnly : true,
										value : respText.manuscript.contributeCompanyPerson.mobilePhone,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '联系人邮箱',
										readOnly : true,
										value : respText.manuscript.contributeCompanyPerson.email,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '稿件分类',
										readOnly : true,
										value : respText.manuscript.manuscriptCategory.manuscriptCategoryName,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '紧急程度',
										readOnly : true,
										value : urgence,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '文档类型',
										readOnly : true,
										value : texttype,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '原稿文种',
										readOnly : true,
										value : language,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '密级',
										readOnly : true,
										value : securityClassification,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '目标语言',
										readOnly : true,
										value : targetLanguage,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '字数',
										readOnly : true,
										value : respText.manuscript.wordNum,
										itemCls:'form_text unedit'

									},
									{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '来稿时间',
										readOnly : true,
										value : contributeTime,
										itemCls:'form_text unedit'
									},{
										autoHeight : true,
										xtype : 'textfield',
										fieldLabel : '计划完成时间',
										readOnly : true,
										value : plannedConsummationTime,
										itemCls:'form_text unedit'
						            },{
						            	fieldLabel : '备注',
						            	xtype: 'panel',
			                            width: 425,
			                            itemCls: 'clear',
										html: changeRemark(respText)
						            } ],
						      buttons:[{
						    	  text:'关闭',
						    	  handler:function(){
						    	  mywindow.close();
						      }
						      }]      
					})
				]
				}).show();
			}
            else {
                Ext.Msg.alert('查看详情失败');
            }
        },
        failure: function(){
            Ext.Msg.show({
                title: '错误提示',
                msg: '修改失败!',
                buttons: Ext.Msg.OK,
                icon: Ext.Msg.ERROR,
                width: 200
            });
        }
    });
};

function changeRemark(respText){
	return "<div align=\"center\"><a href='javascript:void(0)'  onclick=javascript:showRemark('" + respText.manuscript.manuscriptId + "')>备注详情</a></div>";
}

window.showRemark = function(v){
    Ext.Ajax.request({
        url: 'receiver_manuscriptInfo_view.action',
        method: 'post',
        params: {
            manuscriptId: v
        },
        success: function(resp, opts){
            var respText = Ext.util.JSON.decode(resp.responseText);
            if (respText.success) {
                var window_remark = new Ext.Window({
                    title: '备注详情',
                    closable: false,
                    width: 600,
                    resizable: false,
                    height: 400,
                    iconCls: 'manuscript',
                    modal: true,
                    constrain: true,
                    closeAction: 'close',
                    layout: 'fit',
                    items: [{
                        xtype: 'htmleditor',
                        enableAlignments: false,
                        enableColors: false,
                        enableFont: false,
                        enableFontSize: false,
                        enableFormat: false,
                        enableLinks: false,
                        enableLists: false,
                        enableSourceEdit: false,
                        readOnly: true,
                        value: respText.manuscript.remark
                    }],
                    buttons: [{
                        text: '关闭',
                        handler: function(){
                            window_remark.close();
                        }
                    }]
                
                
                }).show();
            }
        },
        failure: function(){
            Ext.Msg.show({
                title: '错误提示',
                msg: '查看失败!',
                buttons: Ext.Msg.OK,
                icon: Ext.Msg.ERROR,
                width: 200
            });
        }
    })
}

/** 查看稿件END*/

// 交稿操作START
window.contribute = function(manuscriptWorkId,title,contributeCompanyName,principalName,securityClassification,manuscriptId){
	Ext.Ajax.request({
		url : 'receiver_checkWorkIsAchieve_check.action',
		method : 'post',
		params : {
			manuscriptWorkId : manuscriptWorkId
		},
		success:function(resp,opts){
			var respText=Ext.util.JSON.decode(resp.responseText);
			if (respText.success) {
				doConfirm();
			}else{
				 Ext.Msg.show({
				    	title : '操作提示',
						msg : respText.errorMessage,
						buttons : Ext.Msg.OK,
						icon: Ext.Msg.ERROR,
						width : 200
				    });
			}
		},
		failure:function(form,action){
			 Ext.Msg.show({
		    	title : '操作提示',
				msg : '操作失败！',
				buttons : Ext.Msg.OK,
				icon: Ext.Msg.ERROR,
				width : 200
		    });
		}
	});
	function doConfirm(){
		Ext.MessageBox.confirm('操作提示','一旦交稿,您将不能进行任何修改确认交稿?',callback);
	}
	function callback(id){
		if(id=='yes'){
			var window_contribute=new Ext.Window({
                    title: rolename,
                    width : 600,
					resizable : false,
					autoHeight : true,
					modal : true,
					closable:false, 
					closeAction : 'hide',
                    items: [
                        contributeForm=new Ext.FormPanel({
                        border : false,
						labelAlign : 'right',
						plain:true,
						labelWidth : 100,
						fileUpload : true,
						frame : true,
                        items: [{
                            fieldLabel: '稿件标题',
                            xtype: 'textfield',
							readOnly : true,
                            value: title,
							anchor :'93%',
							itemCls : "unedit"
                        }, {
                            autoHeight : true,
							xtype : 'textfield',
							fieldLabel : '来稿单位',
							readOnly : true,
							value : contributeCompanyName,
							itemCls:'form_text unedit'
                        },{
                        	autoHeight : true,
  							xtype : 'textfield',
  							fieldLabel : '统稿人',
  							readOnly : true,
  							value : principalName,
  							itemCls:'form_text unedit'
                        },{
							name:'wordNum',
							fieldLabel : '字数',
							xtype:'textfield',
							allowBlank: false,
							regex:/^[1-9][0-9]{0,8}$/,
							regexText:'请输入长度小于等于9且最小值为1的合法正整数',
							itemCls:'form_text'
								
						},{
							fieldLabel: '上传稿件',
							id:'upload',
							name:"fileuploadfield",
							xtype:'fileuploadfield',
							width: 425,
							emptyText:'请选择文件(最大允许值50M)',
							itemCls: 'clear',
								validator : function(value) {
								var type = ['rar', 'doc', 'xls', 'pdf', 'ppt',
										'txt', 'zip', 'docx'];
								if (value !=null&&value!="") {
									var fileType = value.substring(value
											.lastIndexOf(".")
											+ 1).toLowerCase();
									for (var i = 0; i < type.length; i++) {
										if (type[i] == fileType) {
											return true;
										}
									}
									return '请上传如下格式的文件:[rar,doc,xls,pdf,ppt,txt,zip,docx]';
								}
							}
						},{
                            name: 'remark',
                            fieldLabel: '备注',
                            xtype: 'textarea',
                            maxLength:200, 
                            maxLengthText:'超过了最大字符数200' ,
							anchor : '93%',
							itemCls:'clear'
                        }]
                    })],
                    buttons: [{
                        text: '交稿',
                        handler: function(){
                    	if(contributeForm.form.isValid()){
                    		contributeForm.form.doAction(
                    				'submit',{
                    					url: 'receiver_principalSubmitManuscript_submit.action',
                    					waitMsg:'请稍等...',
                    					method: 'post',
                    					params : {
                    						manuscriptWorkId:manuscriptWorkId,
                    						securityClassification:securityClassification,
                    						manuscriptId:manuscriptId
                    					},
                    					success: function(form,action){
                    						if (action.result.success) {
                    							if (action.result.uploadSuccess == undefined) {
                    								Ext.Msg.show({
    													title : '操作提示',
    													msg : '文件大于最大允许值50M!',
    													buttons : Ext.Msg.OK,
    													icon : Ext.Msg.ERROR,
    													width : 200
    												});
                    							}else if (action.result.uploadSuccess == "true") {
                    								window_contribute.close();
                    								ds_draw.reload();
                    								Ext.Msg.show({
                    									title : '操作提示',
                    									msg : '交稿成功!',
                    									buttons : Ext.Msg.OK,
                    									icon : Ext.Msg.INFO,
                    									width : 200
                    								});
                    							}
                    						}else{
                    							Ext.Msg.show({
    												title : '错误提示',
    												msg : action.result.errorMessage,
    												buttons : Ext.Msg.OK,
    												icon : Ext.Msg.ERROR,
    												width : 200
    											});
                    						}
                    					},
                    				    failure:function(form,action){
                    						 Ext.Msg.show({
                     					    	title : '操作提示',
     											msg : action.result.errorMessage,
     											buttons : Ext.Msg.OK,
     											icon: Ext.Msg.ERROR,
     											width : 200
                     					    });
                    					}
                    				}
                    		);
                    		
                    	}
                        }
                    }, {
                        text: '取消',
                        handler: function(){
                            window_contribute.close();
                        }
                    }]
			}).show();
		}
	}
};
//交稿操作End
//查看工作人員詳情start
window.detailsView=function(needparam){
    var receiver_rs_view = new Ext.data.JsonReader({
        root: 'manuscriptWorkers',
        totalProperty: 'totalCount'
    }, [{
        name: 'manuscriptWorkId',// 稿件工作标识
        mapping: 'manuscriptWorkId',
        hidden: 'true'
    }, {
        name: 'manuscriptWorkerId',// 稿件工作人员标识
        mapping: 'manuscriptWorkerId',
        hidden: 'true'
    }, {
        name: 'manuscriptWorkerName', // 稿件工作人员姓名
        mapping: 'manuscriptWorkerName'
    }, {
        name: 'plannedFinishedTime',// 计划完成时间
        mapping: 'plannedFinishedTime'
    }, {
        name: 'startTime',// 工作开始时间
        mapping: 'startTime'
    }, {
        name: 'actualFinishedTime',//实际完成时间
        mapping: 'actualFinishedTime'
    },{
    	name:'confirmedTimestamp',//确认时间
    	mapping:'confirmedTimestamp',
    	hidden:'true'
    },{
    	name:'status',
    	mapping:'status',
    	hidden:'true'
    }]);
    var receiver_ds_view = new Ext.data.Store({
    	baseParams:{manuscriptWorkId:needparam},
        proxy: new Ext.data.HttpProxy({
            url: 'receiver_listWorkersByManuscriptWorkId_list.action',
            method: 'POST'
        }),
        reader: receiver_rs_view
    });
    var receiver_cm_view = new Ext.grid.ColumnModel([new Ext.grid.RowNumberer(), {
        header: "工作人员",
        width: 100,
        dataIndex: 'manuscriptWorkerName'
    
    }, {

        header: "工作开始时间",
        width: 100,
        dataIndex: 'startTime',
        renderer: function(value, metadata, record){
            return totime(value, metadata, record);
        }
    }, {
	      header: "要求完成时间",
	      width: 100,
	      dataIndex: 'plannedFinishedTime',
	      renderer: function(value, metadata, record){
	          return totime(value, metadata, record);
    	}
    },{
    	header:'状态',
    	width:100,
    	dataIndex:'status',
    	renderer:function(value, metadata, record){
    			if(value==0){
    				return '分发完成';
    			}else if(value==1){
    				return '已分配工作';
    			}else if(value==2){
    				return '已接受工作';
    			}else if(value==3){
    				return '已拒绝工作';
    			}else if(value==4){
    				return '工作已提交';
    			}else if(value==5){
    				return '工作被确认完成';
    			}
    	}
    }]);
    var receiver_grid_view = new Ext.grid.GridPanel({
        loadMask: {
            msg: '数据加载中...'
        },
        ds: receiver_ds_view,
        store: receiver_ds_view,
        region: 'center',
        autoScroll: true,
        cm: receiver_cm_view,
        autoExpandColumn: 4,
        autoWidth: true,
        height: 300,
        bbar: new Ext.PagingToolbar({
            pageSize: 10,
            store: receiver_ds_view,
            displayInfo: true,
            beforePageText: '第',
            afterPageText: '页-共{0}页',
            displayMsg: '显示{0} - {1} 条  共 {2} 条',
            emptyMsg: "没有记录"
        })
    });
    receiver_ds_view.load({
        params: {
            start: 0,
            limit: 10
        }
    });
    var receiver_window_view = new Ext.Window({
    	 iconCls: 'work_finish',
		closable:false,
        title: '稿件工作进度详情',
        width: 470,
        resizable: false,
        Height: true,
        modal: true,
        constrain: true,
        closeAction: 'hide',
        items: [receiver_grid_view],
        buttons: [{
            text: '返回',
            handler: function(){
                receiver_window_view.close();
            }
        }]
    
    }).show();
};
//查看工作人員詳情end
var grid_draw = new Ext.grid.GridPanel({
    title: rolename,
    loadMask: {
        msg: '数据加载中...'
    },
    ds: ds_draw,
    store: ds_draw,
    region: 'center',
    autoScroll: true,
    cm: cm_draw,
    autoExpandColumn: 1,
    bbar: new Ext.PagingToolbar({
        pageSize: 20,
        store: ds_draw,
        displayInfo: true,
        beforePageText: '第',
        afterPageText: '页-共{0}页',
        displayMsg: '显示{0} - {1} 条  共 {2} 条',
        emptyMsg: "没有记录"
    })
});
ds_draw.load({
    params: {
        start: 0,
        limit: 20
    }
});
var p_draw = {
    id: module.id,
    border: false,
    layout: 'border',
    items: [grid_draw]
};
Ext.getCmp('content-panel').add(p_draw);
Ext.getCmp('content-panel').layout.setActiveItem(module.id);
Ext.getCmp('content-panel').uxmodules="undefined";
